<table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tbody>
    	{*
    	{if $AppUI->id > 0 && $AppUI->id == $objUser->id} onmouseover="javascript:onMouseOverForImg({$arrImage.imageid});" onmouseout="javascript:onMouseOutForImg({$arrImage.imageid})"{/if}
        *}
        <tr>
            <td align="left" valign="middle" width="46">
                {if $intOffsetA > 0 && $intPageA > 1 && (($intPageA-1)*$intLimitA) < $intTotalA}
                    <a href="javascript:;" onclick="javascript:pagingAlbum({$arrImage.userid},{$arrImage.albumid},{$intPageA-1});"><img src="{$smarty.const.HOST_STATICS}img/btn/photo-pre.png" alt="photo previous" border="0" width="46" height="46" /></a>
                {else}
                    &nbsp;
                {/if}
            </td>
            <td>
            	{*
            	<div class="sAction" id="sAct{$arrImage.imageid}">
                	<ul>
                    	<li><a href="javascript:;" onclick="javascript:deleteImage({$arrImage.imageid},{$arrImage.albumid});">Xóa</a></li>
                        <li><a href="#">Mô tả ảnh</a></li>
                        <li><a href="#">Tag hình</a></li>
                        
                    </ul>
                </div>
                *}
                <div class="border650">
                    {image path=$arrImage.path type=2}
                </div>
            </td>
            <td align="left" valign="middle"width="46">
                {if (($intPageA+1)*$intLimitA) <= $intTotalA}
                    <a href="javascript:;" onclick="javascript:pagingAlbum({$arrImage.userid},{$arrImage.albumid},{$intPageA+1});"><img src="{$smarty.const.HOST_STATICS}img/btn/photo-next.png" alt="photo next" border="0" width="46" height="46" /></a>
                {else}
                    &nbsp;
                {/if}
            </td>
        </tr>
        <tr>
        	<td>&nbsp;</td>
            <td>
            	<ul class="pStat clearIt">
                	<li class="firstChild">
                    	<span class="photoTime">{$arrImage.postdate|convert_date}</span>
                    </li>
                    {if $AppUI->id == $arrImage.userid && $AppUI->id > 0}
                    	<li><a href="javascript:;" onclick="javascript:deleteImage({$arrImage.imageid},{$arrImage.albumid});" class="photoDelete">Xóa hình</a></li>
                    {elseif $arrImage.status != 1}
                    	<li><a href="javascript:;" onclick="javascript:{if $AppUI->id > 0}report({$arrImage.userid},{$arrImage.imageid},2);{else}login();{/if}" class="photoReport">Báo vi phạm</a></li>
                    {/if}
                    <li><span class="photoComment"><a href="javascript:;" onclick="javascript:cmtFocus('Viết bình luận','pcontent','Viết bình luận')">Bình luận</a> (<strong id="photoCmt">{$intTotal|number_format:"0":",":"."}</strong>)</span></li>
                </ul>
                <ul class="seLike">
                	<li>
                    	<a href="#focusCmt" onclick="javascript:likeImage({$arrImage.imageid});"><img src="{$smarty.const.HOST_STATICS}img/btn/p-like.gif" alt="Like photo" border="0" width="112" height="26" /></a>
                    </li>
                    <li class="noLike">
                    	<strong class="pLike" id="pLike">{$arrImage.tlike|number_format:"0":",":"."}</strong>
                    </li>
                </ul>
            </td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>
<div class="photoCmt">
	<div id="sComment" class="sComment">
		{include file="fullhouse/box-album-comment.tpl"}
    </div>
    {if $AppUI->id > 0}
        <div class="photoCmtInput" id="formCmt">
            <a name="focusCmt"></a>
            <form method="post" name="frmComment" id="frmComment" action="" enctype="multipart/form-data">
                <input type="hidden" name="pimageid" id="pimageid" value="{$arrImage.imageid}" />
                {comment name="pcontent" default="Viết bình luận"}
            </form>
        </div>
        <div id="loading" class="blogLoading">
            <p align="center"><img src="{$smarty.const.HOST_STATICS}img/bg/loading-bar.gif" alt="loading" width="88" height="7" border="0" /></p>
            <p>&nbsp;</p>
            <p align="center">Đang xử lý gửi bình luận của bạn. Vui lòng chờ trong giây lát.</p>
            <p>&nbsp;</p>
        </div>
   	{else}
    	<div class="notContent">Bạn vui lòng <a href="{$smarty.const.LINK_INDEX+LOGIN}">đăng nhập</a> để gửi bình luận ảnh.</div>
    {/if}
</div>
{literal}
<script type="text/javascript" language="javascript">
	$(document).ready(function() {
		$("#frmComment").validate({
			errorClass		: "errorMessage",
			errorElement	: "span",
			onfocusout		: false,
			onkeyup			: false,
			rules: {				
				pcontent: {
					requiredContent		: true,
					minlengthContent	: true
				}
			},
			messages: {	
				pcontent: {
					requiredContent		: content_required,
					minlengthContent	: content_minlength
				}
			},
			errorPlacement: function(label, element) {	
				var id = element.attr("id");	
				label.insertAfter($("#" + id));			
			},
			submitHandler: function(form) {						
				$("#formCmt").hide();
				$("#loading").show();
				var strContent	= encodeURIComponent($("#pcontent").val());	
				var intImageId 	= $("#pimageid").val();
				$.getJSON(				
					HOST_VFRIEND + "comment/pcmtsend?content="+strContent+"&imageid="+intImageId+"&callback=?",		
					function(response) {					
						if(response["error"] == 0) {						
							showUIMessage(response["msg"]);
							$("#sComment").html(response["data"]);						
							$("#pCmt").html(response["total"]);
						} else {
							alert(response["msg"]);
						}
						$("#loading").hide();
						$("#formCmt").show();
						$("#pcontent").val("");
						$("#pcontent").val(str_default);			
						if($.browser.msie) {
							$("#pcontent").css("min-height","22px");
							$("#pcontent").css("height","22px");
						} else {
							$("#pcontent").css("min-height","18px");
							$("#pcontent").css("height","18px");
						}
						$("textarea#pcontent").css("color","#999");
						$("#emo_pcontent").hide();
					}
				);
			}
		});
		$.validator.addMethod("requiredContent",function(){
			var strContent	= stripTags($("#pcontent").val());		
			if(strContent == "" || strContent.toLowerCase() == str_default)
				return false;		
			return true;												 
		});
		$.validator.addMethod("minlengthContent",function(){
			var strContent	= stripTags($("#pcontent").val());			
			if(strContent != "" && strContent.toLowerCase() != str_default && strContent.length < 2)
				return false;		
			return true;												 
		});	
	});
</script>
{/literal}